export const generateDate = time => {
  time = '' + time
  const year = time.slice(0, 4)
  const month = time.slice(4, 6)
  const day = time.slice(6, 8)
  return {
    year,
    month,
    day
  }
}

const weekArr = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']

export const getDayOfWeek = time => {
  const date = new Date(time)
  return weekArr[date.getDay()]
}
